package org.pms.core.dao;

import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;

/**
 * Utilitário hibernate para gerenciamento de sessão do Hibernate
 * @author Paulo
 *
 */
public class HibernateUtil {

	private static final SessionFactory sessionFactory; 
	
	   /**
	    * Inicializa session facory
	    */
	   static {  
	      sessionFactory = new AnnotationConfiguration().configure()  
	            .buildSessionFactory();  
	   }  
	  
	   
	   /**
	    * Obter session factory
	    * @return SessionFactory factory de sessoes hibernate
	    */
	   public static SessionFactory getSessionFactory() {  
	      return sessionFactory;  
	   }  
	   
}
